import Vue from 'vue'
import VueRouter from 'vue-router'


//解决重复点击编程式导航报错的问题
const originalPush = VueRouter.prototype.push
const originalReplace = VueRouter.prototype.replace
VueRouter.prototype.push = function push(location) {
  return originalPush.call(this, location).catch(err => err)
}
VueRouter.prototype.replace = function replace(location) {
  return originalReplace.call(this, location).catch(err => err)
}


import routes from '../routes/routes'
Vue.use(VueRouter)
export default new VueRouter({
  routes
})
